package no.sachmuld.methodcombination.examples.annotation.combo.foo;

import no.sachmuld.methodcombination.api.Condition;
import no.sachmuld.methodcombination.api.Context;
import no.sachmuld.methodcombination.api.CrosscuttingBehaviour;
import no.sachmuld.methodcombination.api.MethodInvocation;

/**
 *
 */
public abstract class FooBehaviour extends CrosscuttingBehaviour {

    public void beforeBar(int i) {}

    public String bar(int i, MethodInvocation<String> methodInvocation) {
        return methodInvocation.proceed();
    }

    public void afterBar(int i) {}

    public void beforeBaz(int i) {}

    public String baz(int i, MethodInvocation<String> methodInvocation) {
        return methodInvocation.proceed();
    }

    public void afterBaz(int i) {}

    public boolean or() {
        return false;
    }

    public boolean aroundOr(MethodInvocation<Boolean> methodInvocation) {
        return methodInvocation.proceed();
    }

    public int aroundMin(MethodInvocation<Integer> methodInvocation) {
        return methodInvocation.proceed();
    }

    public abstract int min();

    public Condition beforeMin(Context context) {
        return new Condition(true);
    }

    public Condition afterMin(int result, Context context) {
        return new Condition("result >= 0", result >= 0);
    }

}

